﻿Public Class frmSettings

    Private Sub btnSetUserStock_Click(sender As System.Object, e As System.EventArgs) Handles btnSetUserStock.Click
        frmSetMyStocks.ShowDialog()

    End Sub

    Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click

        g_UIOption.Alert.AlertOn = chkAlertOn.Checked
        g_UIOption.Alert.UpperProfitPercentage = UpperProfit.Value
        g_UIOption.Alert.LowerProfitPercentage = lowerProfit.Value


        If SaveUIOption(g_UIOption) Then
            MsgBox("保存成功")
        End If
    End Sub

    Private Sub frmSettings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        chkAlertOn.Checked = g_UIOption.Alert.AlertOn
        UpperProfit.Value = g_UIOption.Alert.UpperProfitPercentage
        lowerProfit.Value = g_UIOption.Alert.LowerProfitPercentage
    End Sub
End Class